<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="jsp.util.ConnectionContext" %>
<%@ page import="java.sql.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Main</title>
		<link rel=stylesheet href="form.css" type="text/css">

  <Script Language="javaScript">
  
  function Back(){
	  history.back();
  }
  
  function Next(){
	  
	  
	  
  }
  </Script>
  
</head>
<body>
 
 <!------------  DIV 코딩 S--------------->
 
<div id="wrapper" style="border:1px solid #696">
	<jsp:include page="Menubar.jsp" flush="false"/>	


 <%
  	int pass_profNum=Integer.parseInt(request.getParameter("profNum"));

 	int temp=0; 
 	
	try{
	Connection conn = ConnectionContext.getConnection();
	Statement stmt = conn.createStatement();
	
	String strSQL = "SELECT * FROM studentQ";
	
	
	ResultSet rs = stmt.executeQuery(strSQL);				
	for(int i=1;rs.next(); i++){
	 	temp=rs.getInt("numbering");
		
	}rs.close();
	
	
	
	}catch(SQLException ex){
	%>
		에러: <%=ex %>
	<%

		}

	%>
<%
	int number=temp+1;
%>
 	
 	
<center>
	<p></p> 
	<font size='3'><b> Notice </b></font>
	<p></p>             
</center>

<TABLE border="0" width="600" cellpadding="2" cellspacing="2" align="center">
	<TR>
      		<TD>
         		<hr size='1' noshade>
      		</TD>
	</TR>
</TABLE>

 	
 <form action="QandAWrite_Process.jsp" method="post" enctype="multipart/form-data">			<!-- form 에서 등록버튼 아직 구현 못함 -->
 	
 	<INPUT TYPE="hidden" NAME="hiddenvalue" SIZE=10 value="<%=pass_profNum%>">
 	<input type="hidden" name="hiddennumbering" SIZE=10 value="<%=number%>">
 
 	
	<TABLE border="0" width="600" cellpadding="2" cellspacing="2" align="center">
		<tr>
			<TD width="100" bgcolor="cccccc" align=center nowrap><font size="2">Writer</font></td>
			<td><input type="text" size="90"  name="student_name"></td>
		</tr>
		
		<tr>
			<TD width="100" bgcolor="cccccc" align=center><font size="2">학번</font></td>
			<td><input type="text" size="90" name="student_number"></td>
		</tr>
		
		<tr>
			<TD width="100" bgcolor="cccccc" align=center><font size="2">Title</font>	</td>
			<td><input type="text" size="90" name="title"></td>
		</tr>
	
		<tr>
			<TD width="100" bgcolor="cccccc" align=center><font size="2">Content</font></td>
			<td><textarea cols='70' rows='15' name='contents'></textarea></td>
		</tr>
		<tr>
			<TD width="100" bgcolor="cccccc" align=center><font size="2">File</font></td>	
			<td><input type="file" size="70" name="photo" value="경로.."></td>
		</tr>
	</table>

	
	
	<input type="reset" name="BTNwriteReset" value="다시작성">
	<input type="submit" name="BTNwriteRegist" value="등록"  >
</form>
 	

</div><!--wrapper div -->
 
  <!------------   DIV 코딩 E--------------->

 
</body>

</html>